#ifdef CHANGED

#ifndef FRAMEPROVIDER_H
#define FRAMEPROVIDER_H

#include "copyright.h"
#include "utility.h"
#include "openfile.h"
#include "bitmap.h"

// Definitions helpful for representing a bitmap as an array of integers
#define BitsInByte 	8
#define BitsInWord 	32

// The following class defines a "bitmap" -- an array of bits,
// each of which can be independently set, cleared, and tested.
//
// Most useful for managing the allocation of the elements of an array --
// for instance, disk sectors, or main memory pages.
// Each bit represents whether the corresponding sector or page is
// in use or free.

class FrameProvider
{
  public:
     FrameProvider (int nbelem);	// Initialize a bitmap, with "nitems" bits
    // initially, all bits are cleared.
     ~FrameProvider ();		// De-allocate bitmap

	int GetEmptyFrame (bool byrand);	// Retourne le numero d'un cadre libre et initialisé à zéro
	
	void ReleaseFrame(int num);		// Libere le cadre num obtenu par GetEmptyFrame
	
	int NumAvailFrame();	// Retourne le nombre de cadres disponibles
	
  private:
    BitMap *fp_map;
};

#endif // FRAMEPROVIDER_H
#endif // CHANGED
